var ToolBarView = Class.extend({
    ToolBar: null,
    el1: null, //jQuery element
    el2: null,
    el3: null,
    el4: null,
    el5: null,
    init: function (ToolBar) {
        this.ToolBar = ToolBar;
        this.el1 = $("<div class='toolBar'></>");
        $(".ScoreField").append(this.el1);
        this.el1.css({
            top: this.ToolBar.top,
            left: this.ToolBar.left
        });
        this.ToolBar = ToolBar;
        this.el2 = $("<div class='toolBar'></>");
        $(".ScoreField").append(this.el2);
        this.el2.css({
            top: this.ToolBar.top,
            left: this.ToolBar.left+45
        });
        this.ToolBar = ToolBar;
        this.el3 = $("<div class='toolBar'></>");
        $(".ScoreField").append(this.el3);
        this.el3.css({
            top: this.ToolBar.top,
            left: this.ToolBar.left + 90
        });
        this.ToolBar = ToolBar;
        this.el4 = $("<div class='toolBar'></>");
        $(".ScoreField").append(this.el4);
        this.el4.css({
            top: this.ToolBar.top,
            left: this.ToolBar.left + 135
        });
        this.ToolBar = ToolBar;
        this.el5 = $("<div class='toolBar'></>");
        $(".ScoreField").append(this.el5);
        this.el5.css({
            top: this.ToolBar.top,
            left: this.ToolBar.left + 180
        });
        this.el1.css('background-color', 'yellow')
        this.el2.css('background-color', 'gray');
        this.el3.css('background-color', 'gray');
        this.el4.css('background-color', 'gray');
        this.el5.css('background-color', 'gray');
        this.el1.css('color', 'black');
        this.el2.css('color', 'black');
        this.el3.css('color', 'black');
        this.el4.css('color', 'black');
        this.el5.css('color', 'black');
    },
    updateStatus: function (GreenMonster) {
        //alert(GreenMonster.weapon);
        this.el1.text('inf');
        this.el2.text(GreenMonster.weapons[1]);
        this.el3.text(GreenMonster.weapons[2]);
        this.el4.text(GreenMonster.weapons[3]);
        this.el5.text(GreenMonster.weapons[4]);
        if (GreenMonster.status == "oneBullet") {
            this.el1.css('background-color', 'yellow');
            this.el2.css('background-color', 'gray');
            this.el3.css('background-color', 'gray');
            this.el4.css('background-color', 'gray');
            this.el5.css('background-color', 'gray');
        }
        if (GreenMonster.status == "doubleBullet") {
            this.el1.css('background-color', 'gray');
            this.el2.css('background-color', 'yellow');
            this.el3.css('background-color', 'gray');
            this.el4.css('background-color', 'gray');
            this.el5.css('background-color', 'gray');
        }
        if (GreenMonster.status == "tripleBullet") {
            this.el1.css('background-color', 'gray');
            this.el2.css('background-color', 'gray');
            this.el3.css('background-color', 'yellow');
            this.el4.css('background-color', 'gray');
            this.el5.css('background-color', 'gray');
        }
        if (GreenMonster.status == "Laser") {
            this.el1.css('background-color', 'gray');
            this.el2.css('background-color', 'gray');
            this.el3.css('background-color', 'gray');
            this.el4.css('background-color', 'yellow');
            this.el5.css('background-color', 'gray');
        }
        if (GreenMonster.status == "shrapnel") {
            this.el1.css('background-color', 'gray');
            this.el2.css('background-color', 'gray');
            this.el3.css('background-color', 'gray');
            this.el4.css('background-color', 'gray');
            this.el5.css('background-color', 'yellow');
        }


    }
})